package com.androidhuman.example.DualPane;

import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class DetailFragment extends Fragment{

	public static String[] details 
		= new String[]{"Android 1.5, API Level 3", "Android 1.6, API Level 4",
						"Android 2.0-2.1, API Level 5-7", "Android 2.2, API Level 8",
						"Android 2.3-2.3.3, API Level 9-10",
						"Android 3.0-3.1, API Level 11-12",
						"Android ?.?, API Level 13?"};
	
	public static DetailFragment newInstance(int index){
		DetailFragment fragment = new DetailFragment();
		Bundle args = new Bundle();
		args.putInt("index", index);
		fragment.setArguments(args);
		return fragment;
	}
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		ViewGroup view = (ViewGroup)inflater.inflate(R.layout.detail, null);
		TextView tv = (TextView)view.findViewById(R.id.contentText);
		tv.setText(details[getArguments().getInt("index", 0)]);
		return view;
	}
	
}
